/**
 * @Description:
 * @Author BPF
 * @create 2021/8/30 19:48
 */
const BacksysLayout = () => import('@libs/layouts/backsys')

/* 后台*/
export const backsysRoutes = [
  {
    path: '/backsys/home',
    meta: { title: '门户首页', icon: 'icon-portal-site-shouye', isSingle: true },
    component: BacksysLayout,
    redirect: '/backsys/home/index',
    children: [
      {
        path: '/backsys/home/index',
        meta: { title: '门户首页', icon: 'icon-portal-site-shouye', cache: true, iframe: true },
        component: () => import('@/views/backsys/home/')
      }
    ]
  },

  {
    path: '/backsys/stand-know-service',
    meta: { title: '标准化知识服务', icon: 'icon-portal-site-renwu', isSingle: true },
    component: BacksysLayout,
    redirect: '/backsys/stand-know-service/index',
    children: [
      {
        path: '/backsys/stand-know-service/index',
        meta: { title: '标准化知识服务', icon: 'icon-portal-site-renwu', cache: true, iframe: true },
        component: () => import('@/views/backsys/stand-know-service/')
      }
    ]
  },

  {
    path: '/backsys/sci-research-service',
    meta: { title: '协同科研服务', icon: 'icon-portal-site-keyanfuwu', isSingle: true },
    component: BacksysLayout,
    redirect: '/backsys/sci-research-service/index',
    children: [
      {
        path: '/backsys/sci-research-service/index',
        meta: { title: '协同科研服务', icon: 'icon-portal-site-keyanfuwu', cache: true, iframe: true },
        component: () => import('@/views/backsys/sci-research-service/')
      }
    ]
  },

  {
    path: '/backsys/sci-res-info-exchange',
    meta: { title: '标准化科研信息交流', icon: 'icon-portal-site-liebiao1' },
    component: BacksysLayout,
    redirect: '/backsys/sci-res-info-exchange/list',
    children: [
      {
        path: '/backsys/sci-res-info-exchange/list',
        meta: { title: '科研信息列表', icon: 'icon-portal-site-ziliaoshouce-xianxing', cache: true, iframe: true },
        component: () => import('@/views/backsys/sci-res-info-exchange/list/')
      },
      {
        path: '/backsys/sci-res-info-exchange/check',
        meta: { title: '科研信息审核', icon: 'icon-portal-site-shenhe1', cache: true, iframe: true },
        component: () => import('@/views/backsys/sci-res-info-exchange/check/')
      }
    ]
  },

  {
    path: '/backsys/train-materials',
    meta: { title: '标准化培训资料', icon: 'icon-portal-site-ketangpeixun' },
    component: BacksysLayout,
    redirect: '/backsys/train-materials/list',
    children: [
      {
        path: '/backsys/train-materials/list',
        meta: { title: '培训资料列表', icon: 'icon-portal-site-liebiao', cache: true, iframe: true },
        component: () => import('@/views/backsys/train-materials/list/')
      },
      {
        path: '/backsys/train-materials/add',
        meta: { title: '培训资料新增', icon: 'icon-portal-site-xinzeng1', cache: true, iframe: true },
        component: () => import('@/views/backsys/train-materials/add/')
      },
      {
        path: '/backsys/train-materials/edit/:id',
        meta: { title: '培训资料编辑', icon: 'el-icon-document', cache: true, iframe: true, hidden: true },
        component: () => import('@/views/backsys/train-materials/edit/')
      }
    ]
  },

  {
    path: '/backsys/setting',
    meta: { title: '系统设置', icon: 'icon-portal-site-shezhi' },
    component: BacksysLayout,
    redirect: '/backsys/setting/user-manage',
    children: [
      {
        path: '/backsys/setting/user-manage',
        meta: { title: '用户管理', icon: 'icon-portal-site-yonghuguanli', cache: true },
        component: () => import('@/views/backsys/setting/user-manage/')
      },
      {
        path: '/backsys/setting/roles-manage',
        meta: { title: '角色管理', icon: 'icon-portal-site-jiaoseguanli', cache: true },
        component: () => import('@/views/backsys/setting/roles-manage/')
      },
      {
        path: '/backsys/setting/menus-manage',
        meta: { title: '菜单管理', icon: 'icon-portal-site-caidanguanli', cache: true },
        component: () => import('@/views/backsys/setting/menus-manage/')
      },
      {
        path: '/backsys/setting/log-manage',
        meta: { title: '日志管理', icon: 'icon-portal-site-qiantairizhiguanli', cache: true },
        component: () => import('@/views/backsys/setting/log-manage/')
      },
      {
        path: '/backsys/setting/department-manage',
        meta: { title: '部门管理', icon: 'icon-portal-site-bumenguanli', cache: true },
        component: () => import('@/views/backsys/setting/department-mange/')
      }
    ]
  }

  // {
  //   path: '/index/components',
  //   redirect: '/template/components/editor',
  //   meta: { title: '组件', icon: 'el-icon-menu' },
  //   component: BacksysLayout,
  //   children: [
  //     {
  //       path: '/template/components/tinymce',
  //       meta: { title: 'g-tinymce', icon: 'el-icon-document', cache: true, iframe: true },
  //       component: () => import('@/views/template/components/tinymce/index')
  //     },
  //     {
  //       path: '/template/components/table',
  //       meta: { title: 'g-table', icon: 'el-icon-document', cache: true },
  //       component: () => import('@/views/template/components/table/index')
  //     },
  //     {
  //       path: '/template/components/title',
  //       meta: { title: 'g-title', icon: 'el-icon-document', cache: true },
  //       component: () => import('@/views/template/components/title/index')
  //     },
  //     {
  //       path: '/template/components/spin',
  //       meta: { title: 'g-spin', icon: 'el-icon-document', cache: true },
  //       component: () => import('@/views/template/components/spin/index')
  //     },
  //     {
  //       path: '/template/components/excel',
  //       meta: { title: 'excel', icon: 'el-icon-document' },
  //       component: () => import('@/views/template/components/excel/index')
  //     },
  //     {
  //       path: '/template/components/jsplumb',
  //       meta: { title: '工作流-jsplumb', icon: 'el-icon-document' },
  //       component: () => import('@/views/template/components/jsplumb/index')
  //     },
  //     {
  //       path: '/template/components/vnc',
  //       meta: { title: 'vnc', icon: 'el-icon-document', cache: true },
  //       component: () => import('@/views/template/components/vnc/index')
  //     },
  //     {
  //       path: '/template/components/monitor',
  //       meta: { title: '交换监控', icon: 'el-icon-document' },
  //       component: () => import('@/views/template/components/monitor/index')
  //     },
  //     {
  //       path: '/template/components/table/:id',
  //       meta: { title: 'g-table', icon: 'el-icon-document', cache: true, iframe: true },
  //       component: () => import('@/views/template/components/detail-1/index')
  //     },
  //   ]
  // },

  // {
  //   path: '/index/dashboard',
  //   component: BacksysLayout,
  //   icon: 'iconfont-pc bpf-icon-xuanzhongshangcheng',
  //   redirect: '/index/home',
  //   meta: { title: '首页', isSingle: true },
  //   children: [
  //     {
  //       path: '/index/home',
  //       name: 'dashboard_home',
  //       meta: { title: '面板', icon: 'el-icon-document', hidden: true, cache: true },
  //       component: () => import('@/views/template/dashboard/home/')
  //     }
  //   ]
  // }
]

export const publicRoutes = [
  {
    path: '/authorization',
    name: 'authorization',
    meta: { hidden: true },
    component: () => import('@/views/default/authorization/')
  },
  {
    path: '/',
    redirect: '/backsys/home/index',
    meta: { hidden: true }
  },
  {
    path: '/test/hhh',
    meta: { hidden: true },
    component: () => import('@views/default/test/')
  },
  {
    path: '/backsys/login',
    meta: { title: '登陆页面', icon: 'el-icon-document', hidden: true },
    component: () => import('@views/default/login/')
  },
  {
    path: '/backsys/register',
    meta: { title: '用户注册页面', icon: 'el-icon-document', hidden: true },
    component: () => import('@views/default/register/')
  }
]

const errorRoutes = [
  { path: '*', redirect: '/404', name: '/404', meta: { hidden: true } },
  {
    path: '/404',
    component: BacksysLayout,
    redirect: `/404`,
    meta: { title: '错误', hidden: true, icon: 'el-icon-warning' },
    children: [
      {
        path: '/404',
        meta: { title: '页面不存在', hidden: true, icon: 'el-icon-s-release' },
        component: () => import('@/views/template/404/')
      }
    ]
  }
]

export default [...publicRoutes, ...backsysRoutes, ...errorRoutes]
